using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using WorkServiceDemo.Terminal;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddTransient<IOrderService, OrderService>();
builder.Services.AddHostedService<Worker>();

var host = builder.Build();
host.Run();
var orderService = host.Services.GetService<IOrderService>();
var id = orderService.GetId();

Console.WriteLine(id);
Console.ReadLine();